<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<html>
<body>

<script language="javascript" type="text/javascript">
		function sumbimOnce(){
			if($("#content").val() == "" ){
				alert("内容不能为空！ ");
				return;
			}
			$("#form1").submit();
		}
</script>

<ul class="breadcrumb">
  <li><a href="./message.do">系统消息 </a> <span class="divider">/</span> </li>
  <li><a href="./notice.do">系统公告</a> </li>
</ul>

<form id="form1" class="form-horizontal" action="message.do" method="post">
	<div class="control-group" >
		<label class="control-label"for="content">消息内容:</label>
		<div class="controls">
		  <textarea class="input-xxlarge" row="8" name="content" id="content"></textarea>
		</div>         
	</div>
	
	<div class="control-group" >
		<label class="control-label"for="playerIds">接收者id:</label>
		<div class="controls">
		  <textarea class="input-medium" row="4" name="playerIds" id="playerIds"></textarea>
		</div>         
	</div>
	
	<div class="control-group">
		<label class="control-label" for="reason">发送位置: </label>
		<div class="controls">
		  <select class="input-medium" name="channel" id="channel">
		  	<option value="1" id="syschannel" selected > 系统频道 </option>
		  	<option value="2" id=""> 屏幕顶部 </option>
		  </select>
		   <input type="button" class="btn control" value="立即发送 " onClick="sumbimOnce()"/> <font color="red">( 只发送一次  )</font>
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label" for="sendtime">发送时间 :</label>
		<div class="controls">
			<div class="input-append datepicker" id="datetimepicker"   pickTime=true >
			    <input data-format="yyyy-MM-dd hh:mm" type="text" name="sendtime" id="sendtime"></input>
			    <span class="add-on">
			      <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
			    </span>
		  	</div>		 
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label"for="count">重复次数:</label>
		<div class="controls">
		  <input type="text" class="input-medium" row="4" name="count" id="count"/>  <font color="red"> ( >0 ) </font>
		</div>
	</div>
	
	<div class="control-group">
		<label class="control-label"for="interval">重复间隔:</label>
		<div class="controls">
		  <input type="text" class="input-medium" row="4" name="interval" id="interval"/> 分钟
		  <button type="submit" class="btn control"> 确定   </button>
		</div>
	</div>
		  
</form>

<table class="table table-bordered">
  <thead>
    <tr>
      <th width="10%">发送时间</th>
      <th width="25%">消息内容</th>
      <th width="5%">重复次数</th>
      <th width="5%">重复间隔</th>
      <th width="10%">显示位置</th>
      <th width="10%">操作</th>
      <th width="10%">操作人</th>
    </tr>
  </thead>
  <tbody>
  <c:forEach var="msg" items="${list}">
    <tr>
      <td>${msg.sendTime}</td>
   	  <td>${msg.msgText}</td>
   	  <td>${msg.repeatTimes}</td>
   	  <td>${msg.repInterval}</td>
      <td>${msg.disposition==1?"系统频道":"屏幕顶部"}</td>
      <td><a href="delmsg.do?msgid=${msg.id}"> 删除  </a></td>	
      <td>${msg.operator}</td>	
    </tr>
  </c:forEach>
  </tbody>
</table>
<tags:page1 page="${page}" pageSize="${pageSize }" total="${total }" url="message.do?page="/>
</body>
</html>